<!--
 * @Author: FengTeng
 * @Date: 2021-02-12 15:46:23
 * @LastEditTime: 2021-02-20 11:20:44
 * @LastEditors: FengTeng
 * @Description: Description
 * @FilePath: \spa-manage\src\components\spa-tree\SpaTree.vue
-->
<template>
  <div class="spa-tree">
    <ul class="spa-tree-ul">
      <li
        v-for="node in data"
        :class="{ 'spa-tree-li': true, 'is-actived': node.isActived }"
        :key="node.label"
        @click="handleNodeClick(node)"
      >
        <span>{{ node.label }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "SpaTree",
  props: {
    data: {
      type: Array,
      default: () => {
        return [];
      }
    }
  },
  data() {
    return {};
  },
  methods: {
    handleNodeClick(node) {
      this.$emit("node-click", node);
    }
  }
};
</script>

<style lang="scss" src="./index.scss"></style>
